﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ThaireInvestmentWeb.Util
{
    public class ViewBagUtil
    {
        public static void SetError(dynamic viewBag, string errorMsg, string redirect)
        {
            viewBag.ErrorMsg = errorMsg;
            viewBag.ReDirectUrl = redirect;
        }
        public static void SetInfo(dynamic viewBag, string infoMsg, string redirect)
        {
            viewBag.InfoMsg = infoMsg;
            viewBag.ReDirectUrl = redirect;
        }
        public static void SetCompletedInfo(dynamic viewBag, string redirect)
        {
            viewBag.InfoMsg = "การบันทึกสมบูรณ์";
            viewBag.ReDirectUrl = redirect;
        }
        public static void SetCompletedInfo(dynamic viewBag)
        {
            viewBag.InfoMsg = "การบันทึกสมบูรณ์";
        }
        public static void SetCompletedDeleteInfo(dynamic viewBag)
        {
            viewBag.InfoMsg = "ลบข้อมูลเรียบร้อยแล้ว";
        }
        public static void SetCompletedDeleteInfo(dynamic viewBag, string redirect)
        {
            viewBag.InfoMsg = "ลบข้อมูลเรียบร้อยแล้ว";
            viewBag.ReDirectUrl = redirect;
        }
        public static void SetDataNotFoundInfo(dynamic viewBag)
        {
            viewBag.InfoMsg = "ไม่พบข้อมูล";
        }
    }
}